function [ correct ] = Like( options, lookingFor, throwIfNotFound )
%LIKE Will find the correct value in options
%
%   [ CORRECT ] = LIKE( OPTIONS, LOOKINGFOR, THROWIFNOTFOUND )
%
%   throwIfNotFound: (optional)
%       [ true ] - will throw exception if item can't be found.. (default)
%         false  - will return [] if item can't be found..

%% Initialize
if nargin<2
    error('Not enough arguments');
elseif nargin>3
    error('Too many arguments');
elseif nargin==2
    throwIfNotFound = true; % default
end

%% Find match and return when found
tfExact = strcmp(options, lookingFor);
if any(tfExact)
    correct = options{tfExact};
    return;
end

tfCaseInv = strcmpi(options, lookingFor);
if any(tfCaseInv)
    correct = options{tfCaseInv};
    warning(['Subsituting ' lookingFor ' with ' correct]);
    return;
end

%% No match found
if throwIfNotFound
    error([lookingFor ' not found..']);
else
    correct = [];
end

end

